#ifndef SunBitmap_First
#define SunBitmap_First
#ifdef __GNUG__
#pragma interface
#endif

#include "DevBitmap.h"

class WindowPort;

//---- SunBitmap ---------------------------------------------------------------

class SunBitmap: public DevBitmap {
public:
	struct pixrect *pr;

public:
	SunBitmap(Point sz, u_short *data, u_short depth, bool freedata= FALSE);
	SunBitmap(pixrect *npr, bool copy= TRUE);
	~SunBitmap();

	void SetData(BitmapInfo *bi, void *data);
	void ReadData(BitmapInfo *bi, IStream &is);
	void SetRow(BitmapInfo *bi, int row, byte *rowdata);
	void SetPixel(u_int x, u_int y, u_long value);
	u_long GetPixel(u_int x, u_int y);
	void DevMapColors(DevBitmap *src, u_long *map);
	DevBitmap *DevAllocBitmap(const Point &s, u_short d);
	void DevBitBlt(int x, int y, int w, int h, BitBltOp op, DevBitmap *s,
						int sx, int sy, u_long val);
};

extern pixrect *ScalePixrect(pixrect *pr, int sx, int sy);
extern bool NewPixrect(pixrect **prp, Point e, bool exact, bool clear, int depth);
extern pixrect *ClonePixrect(pixrect *pr);

#endif


